package com.aos.dao;

import com.aos.entity.User_Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface UserRoleDao extends JpaRepository<User_Role, Long> {

//    /**
//     *
//     * @Description:查询用户角色信息
//     * @throws
//     */
//    User_Role findByRidAndUidAndServiceid(Long uid,Long rid);
//
//    /**
//     *
//     * @Description:新增用户角色信息
//     *
//     */
//    @Transactional
//    @Modifying(clearAutomatically = true)
//    @Query(value = "insert into user_role (uid, username,serviceid,rid) values (?1,?2,?3,?4)",nativeQuery = true)
//    int insertUserRole(Long uid,String username,String serviceid,Long rid);
//
//    /**
//     *
//     * @Description:更新用户角色信息
//     *
//     */
////    @Transactional
////    @Modifying(clearAutomatically = true)
////    @Query(value = "update user_role set rid =?3 where uid = ?1 and serviceid = ?2",nativeQuery = true)
////    int updateUserRole(long uid,String serviceid,long rid);
//
//    /**
//     *
//     * @Description:删除用户角色信息
//     *
//     */
//    @Transactional
//    @Modifying(clearAutomatically = true)
//    @Query(value = "delete from user_role where uid = ?1 and rid = ?2",nativeQuery = true)
//    int deleteUserRole(long uid,long rid);
}
